#!/bin/bash

#加载变量
unset PROJECT_HOME
export PROJECT_HOME="$(cd "`dirname "$0"`"/..; pwd)"
. $PROJECT_HOME/bin/load-env.sh
#判断项目是否正在运行，如果正在运行，输出program is running，并退出
ps -ef | grep $CLASSNAME | grep -v grep >/dev/null 2>&1 
if [ $? -eq 0 ];then
  echo "program is running!"
  exit 1;
fi
#启动项目
nohup java -Xms5000m -Xmx5000m -Xmn2000m -Xss256k \
           -XX:+PrintGCDateStamps -XX:+PrintGCDetails  \
           -verbose:gc -Xloggc:$PROJECT_HOME/log/gc.log \
           -XX:+HeapDumpOnOutOfMemoryError \
           -XX:OnOutOfMemoryError="sh $PROJECT_HOME/bin/stop.sh" \
           -DPROJECT_HOME=$PROJECT_HOME \
           -cp $CLASSPATH $CLASSNAME conf/tcp.properties data/采集卡发上位机数据帧监控日志.txt \
           >log/curr.log 2>&1 &
#           >/dev/null 2>&1 &
